package day10;

public class Demo02 {
	public static void main(String[] args) {
		Teacher t = new Teacher();
		t.work();
		Student s = new Student();
		s.work();
		Doctor d = new Doctor();
		d.work();
		// Cannot instantiate the type Worker
		// 抽象类无法创建对象
		//		Worker w = new Worker();
		//		Person p = new Person();

		// 通过接口的实现类的对象访问方法
		UserServiceImpl usi = new UserServiceImpl();
		usi.doSome();
		usi.login("", 123);
		usi.register("", 123);
		// 接口中的常量与类中的常量一样, 可以直接通过接口访问
		System.out.println(UserService.X);
		

	}
}
